import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class TestRandomBoard extends TestCase {
    private static final Class thisClass = TestRandomBoard.class;

    public static void main(String[] args) {
        if (args.length >= 1 && args[0].equals("text")) {
            junit.textui.TestRunner.run(thisClass);
        } else {
            junit.swingui.TestRunner.run(thisClass);
        }
    }

    public static Test suite() {
        return new TestSuite(thisClass);
    }

    public void testIsSane() {
        for (int i = 0; i < 1000000; i++) {
            Board board = RandomBoard.randPieces();
            assertTrue(board.isSane());
        }
    }
}
